<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\UserController;
use App\Http\Middleware\JwtMiddleware;
Route::get('/test', [UserController::class, 'test']);


Route::post('/register', [UserController::class, 'register']);
Route::post('/login', [UserController::class, 'login']);


// 测试令牌jwttoken
Route::post('/protected', function () {
    return response()->json(['message' => '你成功通过了验证']);
})->middleware(JwtMiddleware::class);



Route::middleware(JwtMiddleware::class)->group(function () {
    Route::get('/user', [UserController::class, 'index']);
});